<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
         DefaultTargets="Compile">
  <ItemGroup>
    <BuildArtifactsDir Include="BuildArtifacts\" />
    <SolutionFile Include="${solutionName!}" />
  </ItemGroup>

  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
    <BuildPlatform Condition=" '$(BuildPlatform)' == '' ">Any CPU</BuildPlatform>
  </PropertyGroup>
  
  <Target Name="Clean">
    <RemoveDir Directories="@(BuildArtifactsDir)" />
  </Target>
  
  <Target Name="Init" DependsOnTargets="Clean">
    <MakeDir Directories="@(BuildArtifactsDir)" /> 
  </Target>

  <Target Name="Compile" DependsOnTargets="Init">
    <MSBuild Projects="@(SolutionFile)"
             Targets="Rebuild"
             Properties="OutDir=%(BuildArtifactsDir.FullPath);Configuration=$(Configuration);Platform=$(BuildPlatform)" />
  </Target>
</Project>